// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1
import "../delegates"
import "../models"

ListView {
    id: allJobs

    property double mashtab: width/((jobsModel.maxTimeInSeconds - jobsModel.minTimeInSeconds))

    width: 100
    height: 100

    header: Rectangle {
        width: allJobs.width
        height: 20
        ListView {
            anchors.fill: parent
            orientation: ListView.Horizontal
            delegate: DayOfYearElement {}
            model: ListModel {}
        }
    }

    model: jobsModel
    delegate: JobElement {
        minTimeInSeconds: jobsModel.minTimeInSeconds
        mashtab: allJobs.mashtab
    }

    highlight: Rectangle {
        width: allJobs.width
        color: "lightsteelblue";
        radius: 5
    }

    MouseArea {
        anchors.fill: parent
        onClicked: {
            var index = parent.indexAt(mouseX, mouseY)
            if(index >= 0) parent.currentIndex = index
            parent.focus=true
        }
    }
}
